package com.example.designpatterns.behavioral.mediator;

/**
 * 客户端代码（具体使用）
 *
 * @author scott
 */
public class Client {

    public static void main(String[] args) {
        ConcreteMediator mediator = new ConcreteMediator();

        ConcreteColleague1 colleague1 = new ConcreteColleague1(mediator);
        ConcreteColleague2 colleague2 = new ConcreteColleague2(mediator);

        mediator.setColleague1(colleague1);
        mediator.setColleague2(colleague2);

        colleague1.sendMessage("Hello from Colleague1!");
        colleague2.sendMessage("Hi from Colleague2!");
    }

}
